package pers.qianyu.module.recommend.schedule;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import pers.qianyu.module.recommend.service.RecommendService;

/**
 * @author mizzle rain
 * @date 2021-04-21 20:34
 */
@Component
public class RecommendSchedule {
    @Autowired
    private RecommendService recommendService;

    // 每隔一个小时执行一次
    @Scheduled(cron = "0 0 */1 * * ?")
//    @Scheduled(cron = "0 * * * * ?")
    public void execute() {
        recommendService.computeRecommend();
    }
}
